import React, { useState } from 'react';
import { NavBar, Icon } from 'antd-mobile';
import { history } from 'umi';

const TopNavBar = ({pageTitle, backLink = '/home'}: any) => {
    return (
        <NavBar
            mode="light"
            icon={<Icon type="left" />}
            onLeftClick={() => history.push(backLink)}
        >
            {pageTitle}
        </NavBar>
    );
}

export default TopNavBar;